﻿using System;

namespace DingTalk.Common
{
    public class Rand
    {
        /// <summary>
        /// 获取随机数
        /// </summary>
        /// <param name="max">数据最大数</param>
        /// <returns>随机数</returns>
        public static int Random(int max)
        {
            //获取种子值
            int seed = Math.Abs((int)BitConverter.ToUInt32(Guid.NewGuid().ToByteArray(), 0));

            Random random = new Random(seed);

            return random.Next(1, max + 1);
        }
    }
}
